package com.lxm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lxm.dto.Result;
import com.lxm.entity.Follow;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 * 关注表 服务类
 * </p>
 *
 * @author ${author}
 * @since 2024-10-02
 */
public interface FollowService extends IService<Follow> {

    @Transactional
        //这个事务回滚是为了保证SQL和Redis同时成功，否则Redis数据可能丢失
    Result followUser(Long followeeId);

    Result checkFollow(Long followeeId);

    Result getAllFolloweeId();

    @Transactional
        //这个事务回滚是为了保证SQL和Redis同时成功，否则Redis数据可能不同步
    Result deleteFollow(Long followeeId);


    Result getUserFollowList(Long currentId, Long userId);

    Result getUserFanList(Long currentId, Long userId);

}
